#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub enum DamageType {
    Arrow,
    BadRespawnPoint,
    Cactus,
    Campfire,
    Cramming,
    DragonBreath,
    Drown,
    DryOut,
    EnderPearl,
    Explosion,
    Fall,
    FallingAnvil,
    FallingBlock,
    FallingStalactite,
    Fireball,
    Fireworks,
    FlyIntoWall,
    Freeze,
    Generic,
    GenericKill,
    HotFloor,
    InFire,
    InWall,
    IndirectMagic,
    Lava,
    LightningBolt,
    MaceSmash,
    Magic,
    MobAttack,
    MobAttackNoAggro,
    MobProjectile,
    OnFire,
    OutOfWorld,
    OutsideBorder,
    PlayerAttack,
    PlayerExplosion,
    SonicBoom,
    Spit,
    Stalagmite,
    Starve,
    Sting,
    SweetBerryBush,
    Thorns,
    Thrown,
    Trident,
    UnattributedFireball,
    WindCharge,
    Wither,
    WitherSkull,
}
impl DamageType {
    #[doc = r" Try to parse a `DamageType` from a resource location string."]
    pub fn from_name(name: &str) -> Option<Self> {
        let name = name.strip_prefix("minecraft:").unwrap_or(name);
        match name {
            "arrow" => Some(Self::Arrow),
            "bad_respawn_point" => Some(Self::BadRespawnPoint),
            "cactus" => Some(Self::Cactus),
            "campfire" => Some(Self::Campfire),
            "cramming" => Some(Self::Cramming),
            "dragon_breath" => Some(Self::DragonBreath),
            "drown" => Some(Self::Drown),
            "dry_out" => Some(Self::DryOut),
            "ender_pearl" => Some(Self::EnderPearl),
            "explosion" => Some(Self::Explosion),
            "fall" => Some(Self::Fall),
            "falling_anvil" => Some(Self::FallingAnvil),
            "falling_block" => Some(Self::FallingBlock),
            "falling_stalactite" => Some(Self::FallingStalactite),
            "fireball" => Some(Self::Fireball),
            "fireworks" => Some(Self::Fireworks),
            "fly_into_wall" => Some(Self::FlyIntoWall),
            "freeze" => Some(Self::Freeze),
            "generic" => Some(Self::Generic),
            "generic_kill" => Some(Self::GenericKill),
            "hot_floor" => Some(Self::HotFloor),
            "in_fire" => Some(Self::InFire),
            "in_wall" => Some(Self::InWall),
            "indirect_magic" => Some(Self::IndirectMagic),
            "lava" => Some(Self::Lava),
            "lightning_bolt" => Some(Self::LightningBolt),
            "mace_smash" => Some(Self::MaceSmash),
            "magic" => Some(Self::Magic),
            "mob_attack" => Some(Self::MobAttack),
            "mob_attack_no_aggro" => Some(Self::MobAttackNoAggro),
            "mob_projectile" => Some(Self::MobProjectile),
            "on_fire" => Some(Self::OnFire),
            "out_of_world" => Some(Self::OutOfWorld),
            "outside_border" => Some(Self::OutsideBorder),
            "player_attack" => Some(Self::PlayerAttack),
            "player_explosion" => Some(Self::PlayerExplosion),
            "sonic_boom" => Some(Self::SonicBoom),
            "spit" => Some(Self::Spit),
            "stalagmite" => Some(Self::Stalagmite),
            "starve" => Some(Self::Starve),
            "sting" => Some(Self::Sting),
            "sweet_berry_bush" => Some(Self::SweetBerryBush),
            "thorns" => Some(Self::Thorns),
            "thrown" => Some(Self::Thrown),
            "trident" => Some(Self::Trident),
            "unattributed_fireball" => Some(Self::UnattributedFireball),
            "wind_charge" => Some(Self::WindCharge),
            "wither" => Some(Self::Wither),
            "wither_skull" => Some(Self::WitherSkull),
            _ => None,
        }
    }
    pub const fn to_name(&self) -> &'static str {
        match self {
            Self::Arrow => "arrow",
            Self::BadRespawnPoint => "bad_respawn_point",
            Self::Cactus => "cactus",
            Self::Campfire => "campfire",
            Self::Cramming => "cramming",
            Self::DragonBreath => "dragon_breath",
            Self::Drown => "drown",
            Self::DryOut => "dry_out",
            Self::EnderPearl => "ender_pearl",
            Self::Explosion => "explosion",
            Self::Fall => "fall",
            Self::FallingAnvil => "falling_anvil",
            Self::FallingBlock => "falling_block",
            Self::FallingStalactite => "falling_stalactite",
            Self::Fireball => "fireball",
            Self::Fireworks => "fireworks",
            Self::FlyIntoWall => "fly_into_wall",
            Self::Freeze => "freeze",
            Self::Generic => "generic",
            Self::GenericKill => "generic_kill",
            Self::HotFloor => "hot_floor",
            Self::InFire => "in_fire",
            Self::InWall => "in_wall",
            Self::IndirectMagic => "indirect_magic",
            Self::Lava => "lava",
            Self::LightningBolt => "lightning_bolt",
            Self::MaceSmash => "mace_smash",
            Self::Magic => "magic",
            Self::MobAttack => "mob_attack",
            Self::MobAttackNoAggro => "mob_attack_no_aggro",
            Self::MobProjectile => "mob_projectile",
            Self::OnFire => "on_fire",
            Self::OutOfWorld => "out_of_world",
            Self::OutsideBorder => "outside_border",
            Self::PlayerAttack => "player_attack",
            Self::PlayerExplosion => "player_explosion",
            Self::SonicBoom => "sonic_boom",
            Self::Spit => "spit",
            Self::Stalagmite => "stalagmite",
            Self::Starve => "starve",
            Self::Sting => "sting",
            Self::SweetBerryBush => "sweet_berry_bush",
            Self::Thorns => "thorns",
            Self::Thrown => "thrown",
            Self::Trident => "trident",
            Self::UnattributedFireball => "unattributed_fireball",
            Self::WindCharge => "wind_charge",
            Self::Wither => "wither",
            Self::WitherSkull => "wither_skull",
        }
    }
}
